﻿using System.Collections.Generic;

namespace Vestras.StarCraft2.Luna.Parser.Ast {
    public sealed class MemberAccessExpression : Expression {
        List<Expression> parameterExpressions = new List<Expression>();
        List<Expression> arrayDimensionExpressons = new List<Expression>();

        public Expression Member { get; internal set; }
        public ExpressionType Type { get; internal set; }
        public List<Expression> ArrayDimensionExpressions {
            get {
                return arrayDimensionExpressons;
            }
            internal set {
                arrayDimensionExpressons = value;
            }
        }

        public List<Expression> ParameterExpressions {
            get {
                return parameterExpressions;
            }
            internal set {
                parameterExpressions = value;
            }
        }

        public enum ExpressionType {
            VariableAccess,
            FunctionCall,
            ArrayAccess
        }

        public override string ToString() {
            return GetType().Name + " Member = [ " + Member + " ], ArrayDimensionExpressions = [ " + ArrayDimensionExpressions + " ]";
        }
    }
}
